#ifndef COMMONDATA_H
#define COMMONDATA_H

#include <QObject>
#include <QFontMetrics>
#include <QLabel>
#include <QGSettings>
#include <QTimer>
#include <QString>
#include <QStringList>
#include "gsettingmanager.h"


//! 快捷操作面板按鈕大小
#define QUICK_BUTTONWIDTH      90
#define QUICK_BUTTONHEIGHT     100

//! 颜色代码
#define TRAY_ICON_COLOR_LOGHT      0
#define TRAY_ICON_COLOR_DRAK       255


#define BRIGHTNESSDATA 20
#define POWERSAVINGNUM 2


typedef struct pointDataStruct {
    QString module;
    QString function;
    QString functionNum;
    QStringList otherFunction;
    QString errorLevel;
    QString errorOutput;
    QString timeStamp;
} pointDataStruct;


//! 省略显示label实现方法
class LabelFotmatText : public QObject
{
    Q_OBJECT
public:
    LabelFotmatText();
    QString SetFormatBody(QString text, QLabel *CopyDataLabal);

private:
    QLabel  *m_pLabel;
    QString m_pFormatBody;
    bool    m_bTooltips = false;

    void    setWidgetFont();
    void    initLabelText();
};

//! 反转图片颜色
class PictureToWhite : public QObject
{
    Q_OBJECT
public:
    explicit PictureToWhite(QObject *parent = nullptr);
    QPixmap drawSymbolicColoredPixmap(const QPixmap &source);

public:
    void initGsettingValue();
    int  tray_icon_color;

    void updateStyle();

};

#endif // COMMONDATA_H
